<template>
	<!-- 老师/简历列表 -->
	<view>
		<view class='teach_item' v-for="(item,index) in teachers" :key="index" @click="nav_detail(item.userId)">
			<view class='point' v-if="(status==4||status==6)&&item.reverseStatus==2"></view>
			<image class='teach_img' :src="item.avatar?item.avatar:'/static/icon27.png'"></image>
			<view class='teach_wrap'>
				<scroll-view class='teach_desc' scroll-x="true" scroll-with-animation="true">
					<view class='name' v-if="item.nickName||item.userName">{{item.nickName||item.userName}}</view>
					<view class='text' v-if="item.birthday">{{item.age}}岁</view>
					<view class='text' v-if="item.educationName">{{item.educationName}}</view>
					<view class='text' v-if="item.joinWorkTime">{{item.workYear>0?item.workYear+'年':'1年内'}}工作经验</view>
					<view class='text' v-if="item.salaryMax">期望</view>
					<view class='text' style='color: #5B90FF;'>{{item.salary}}</view>
				</scroll-view>
				<view class='teach_label_box' v-if="item.hierarchyName||item.teacherModeName||item.startTimeName">
					<scroll-view class='scroll_label' scroll-with-animation="true" scroll-x="true">
						<view class='label' v-if="item.hierarchyName">{{item.hierarchyName}}</view>
						<view class='label' v-if='item.teacherModeName'>{{item.teacherModeName}}</view>
						<view class='label' v-if='item.startTimeName'>{{item.startTimeName}}</view>
					</scroll-view>
				</view>
				<view class="job_box" v-if='item.works.length>0'>
					<scroll-view class='teach_job' scroll-x="true" scroll-with-animation="true">{{item.works[item.maxIndex].start}} - {{item.works[item.maxIndex].end}} 在{{item.works[item.maxIndex].businessName}} 担任 {{item.works[item.maxIndex].positionName}}</scroll-view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		props: {
		    teachers: {
		        type: Array
			},
			status: {
				type: Number
			}
		},
		methods:{
			// status  1-普通  2-邀请  3-接收  4-投递  5-收藏  6-推送
			nav_detail(id){
				uni.navigateTo({
					url: '/pages/resumeDetail/resumeDetail?id='+id+'&status='+this.$props.status
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.teach_item{
		background: #fff;
		padding: 32rpx;
		margin-bottom: 12rpx;
		display: flex;
		flex-direction: row;
		position: relative;
		.point{
			position: absolute;
			top: 18rpx;
			right: 28rpx;
			width: 16rpx;
			height: 16rpx;
			border-radius: 50%;
			background: #F63236;
		}
		.teach_img{
			width: 48rpx;
			height: 48rpx;
			border-radius:50%;
			margin-right: 10rpx;
			border: 2rpx solid rgba(112, 112, 112, 0.1);
			box-sizing: border-box;
		}
		.teach_wrap{
			flex: 1;
			width: 0;
			.teach_desc{
				overflow: hidden;
				white-space: nowrap;
				margin-bottom: 10rpx;
				height: 40rpx;
				line-height: 36rpx;
				.name{
					display: inline-block;
					height: 40rpx;
					font-size: 28rpx;
					font-weight: 600;
					line-height: 40rpx;
					color:rgba(63,74,88,1);
					margin-right: 20rpx;
				}
				.text{
					display: inline-block;
					height: 32rpx;
					font-size: 22rpx;
					font-weight: 400;
					line-height: 32rpx;
					color:rgba(146,155,167,1);
					margin-right: 20rpx;
				}
			}
			.teach_label_box{
				width: 100%;
				overflow: hidden;
				white-space: nowrap;
				height: 48rpx;
				.scroll_label{
					width: 100%;
					height: 48rpx;
					line-height: 40rpx;
					overflow: hidden;
					.label{
						display: inline-block;
						background: #F6F7F9;
						height: 48rpx;
						line-height: 48rpx;
						padding: 0 16rpx;
						font-size: 24rpx;
						font-weight: 400;
						color:rgba(146,155,167,1);
						border-radius: 8rpx;
						margin-right: 16rpx;
					}
				}
			}
			.job_box{
				overflow: hidden;
				height: 32rpx;
				margin-top: 10rpx;
				.teach_job{
					overflow: hidden;
					white-space: nowrap;
					height: 44rpx;
					font-size: 22rpx;
					font-weight: 400;
					line-height: 32rpx;
					color:rgba(146,155,167,1);
				}
			}
		}
	}
</style>
